package com.ahstu.learning.SubjectActivity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Toast;

import com.ahstu.learning.R;
import com.ahstu.learning.SubjectActivity.SildingFinishLayout.OnSildingFinishListener;
/**
 * 1. 必须设置透明风格,设置透明后需对Activity设置一个背景色，其遮盖效果
 * 2. 要调用initBaseActivity(boolean enableLeftSilde, boolean enableRigftSilde)
 *
 * @ enableLeftSilde : 开启左侧
 * @ enableRightSilde : 开启右侧
 *
 * */
public class BaseCourseActivity extends Activity implements OnSildingFinishListener{
	private SildingFinishLayout sildingLayout;


	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	/**
	 * @enableLeftSilde : 开启左侧
	 * @enableRightSilde : 开启右侧
	 * */
	public void initBaseActivity(boolean enableLeftSilde, boolean enableRigftSilde){
		sildingLayout = (SildingFinishLayout) findViewById(R.id.slidingLayout);
		sildingLayout.setOnSildingFinishListener(this);
		sildingLayout.setEnableLeftSildeEvent(enableLeftSilde);
		sildingLayout.setEnableRightSildeEvent(enableRigftSilde);
	}


	@Override
	public void onSildingBack() {
		//Toast.makeText(getApplicationContext(), "back", Toast.LENGTH_SHORT).show();
		finish();
	}


	@Override
	public void onSildingForward() {
		Toast.makeText(getApplicationContext(), "前进", Toast.LENGTH_SHORT).show();
		finish();
	}
}
